import java.util.Scanner;

public class J07Scanner {
    public static void main(String[] args) {
        int a = 7;
        Scanner s = new Scanner(System.in);
//        System.out.print("输入年龄：");
        //nextint会让程序暂停
//        int m = s.nextInt();
//        System.out.println(m);

        System.out.print("输入名字：");
        String s1 = s.nextLine();
        System.out.println(s1);
        System.out.println("输入的字符串为："+s1);
        System.out.println("s1="+s1);
        //变量名.sout
        System.out.println(s1);
        //变量名.soutv
        System.out.println("s1 = " + s1);
    }
}

class J08{
    public static void main(String[] args) {
        int age = 7;
        System.out.println(age);
        System.out.println("age = " + age);

        //在加法中，如果数字和字符串相遇，数字会自动转为字符串
        System.out.println(1+1);//2
        System.out.println(1+"a"+2);//1a2
        System.out.println("a"+"b");//ab
        System.out.println("1"+"1");//11
        System.out.println(1+1+"a");//2a
        System.out.println("a"+1+1);//a11
    }
}
